package com.csdj.t309springboot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csdj.t309springboot.entity.User;
import com.csdj.t309springboot.mapper.UserMapper;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@RequestMapping("/fenye")
@Controller
public class PageController {
    @Resource
    private UserMapper mapper;

    @GetMapping("/manageMember")
    public String fen(@RequestParam(defaultValue = "1") int pageNum, Model model ){
        Page<User> page = new Page<>(pageNum,3);
        mapper.selectPage(page,null);
//        PageHelper.startPage(pageNum,3);
//        List<User> gamelist=mapper.topicFenYe();
//        PageInfo<User> pageInfo=new PageInfo<>(gamelist);
        model.addAttribute("pageInfo", page);

        return "lunbo";
    }

}
